
function datepicker(params){
		var settings = $.extend(
			    		{},
			    		{
			    			dateId : '',
			    			monthId : '',
			    			yearId: '',
			    			yearBefore: 0,
			    			yearAfter: 0,
					    },params);
		var optiondate = "<option value=\"0\" selected=\"selected\">-Date-</option>";
		for(var i = 1; i< 32; i++){
			optiondate += "\n<option value=\""+ i +"\">"+ i +"</option>";
			$('#' + settings.dateId).empty().append(optiondate);
		}
		
		var optionmonth = "<option value=\"0\" selected=\"selected\">-Month-</option>";
		for(var j = 1; j< 13; j++){
			optionmonth += "\n<option value=\""+ j +"\">"+ j +"</option>";
			$('#' + settings.monthId).empty().append(optionmonth);
		}
		
		var newdate = new Date();
		var year = newdate.getFullYear();
		var optionyear = "<option value=\"\" disabled=\"disabled\" selected=\"selected\">-Year-</option>";
		for(var x = (year - settings.yearAfter); x < (year + settings.yearBefore + 1); x++){
			optionyear += "\n<option value=\""+ x +"\">"+ x +"</option>";
			$('#' + settings.yearId).empty().append(optionyear);
		}
}